package com.pacai.this_;

import java.util.Collection;

/**
 * @author pacai
 * @version 1.0
 */
@SuppressWarnings("all")
public class TestPerson {
    private String name;
    private int age;

    public TestPerson(String name, int age) {
        this.name = name;
        this.age = age;
    }

    private boolean compareTo(TestPerson testPerson) {
        if(this == testPerson)
            return true;
        if(this == null || testPerson == null)
            return false;
        return this.age == testPerson.age && this.name.equals(testPerson.name);
    }

    public static void main(String[] args) {
        TestPerson john = new TestPerson("john", 19);
        TestPerson john1 = new TestPerson("john", 19);
        System.out.println(john.compareTo(john1));
    }
}
